package cn.iocoder.yudao.module.self.dal.mysql.student;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.self.dal.dataobject.student.StudentDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.self.controller.admin.student.vo.*;

/**
 * 学生表--测试使用 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface StudentMapper extends BaseMapperX<StudentDO> {

    default PageResult<StudentDO> selectPage(StudentPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<StudentDO>()
                .eqIfPresent(StudentDO::getNo, reqVO.getNo())
                .likeIfPresent(StudentDO::getName, reqVO.getName())
                .eqIfPresent(StudentDO::getSex, reqVO.getSex())
                .eqIfPresent(StudentDO::getEmail, reqVO.getEmail())
                .eqIfPresent(StudentDO::getRevision, reqVO.getRevision())
                .eqIfPresent(StudentDO::getCreatedBy, reqVO.getCreatedBy())
                .betweenIfPresent(StudentDO::getCreatedTime, reqVO.getCreatedTime())
                .eqIfPresent(StudentDO::getUpdatedBy, reqVO.getUpdatedBy())
                .betweenIfPresent(StudentDO::getUpdatedTime, reqVO.getUpdatedTime())
                .orderByDesc(StudentDO::getId));
    }

}